<?php
    /**
     *  Copyright (c) 2013, dsphinx@plug.gr
     *  All rights reserved.
     *
     *  Redistribution and use in source and binary forms, with or without
     *  modification, are permitted provided that the following conditions are met:
     *   1. Redistributions of source code must retain the above copyright
     *      notice, this list of conditions and the following disclaimer.
     *   2. Redistributions in binary form must reproduce the above copyright
     *      notice, this list of conditions and the following disclaimer in the
     *      documentation and/or other materials provided with the distribution.
     *   3. All advertising materials mentioning features or use of this software
     *      must display the following acknowledgement:
     *      This product includes software developed by the dsphinx.
     *   4. Neither the name of the dsphinx nor the
     *      names of its contributors may be used to endorse or promote products
     *     derived from this software without specific prior written permission.
     *
     *  THIS SOFTWARE IS PROVIDED BY dsphinx ''AS IS'' AND ANY
     *  EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
     *  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
     *  DISCLAIMED. IN NO EVENT SHALL dsphinx BE LIABLE FOR ANY
     *  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
     *  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
     *  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
     *  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
     *  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     *
     *
     */

    return;
    DEFINE ("__AJAX", TRUE);

    require_once ('../Library/Ajax/Ajax.php');

    $_return = NULL;

    if ($results = file_get_contents("php://input")) {

        // $results = json_decode($results, TRUE);
        $results = $_POST; // POST faster for simple calls

        $category = Ajax_Call::IN($results['category']);
        $query = Ajax_Call::IN($results['query']);

       // echo " found = " .$query;

    }



include('../../Private/admin_advert/auth_db.php');
$category  = $param['category'];
$query     = $param['query'];
$action_id = $param['action_id'];
$sql_f1    = 'SELECT field_search.id as fcai, field_search.field_id as fcafi, category_action.id as cai, field_search.category_action_id as fcacai,
 field_search.ordering as fcao, field.name as fn, field.id as fi, category.name as cn, field.parameters as fpara FROM field_search, category_action,
  field, category WHERE field_search.field_id = field.id AND field_search.category_action_id=category_action.id AND category_action.category_id=category.id
   AND category.id=' . $category . ' ORDER BY field_search.ordering';
$result_f1 = mysqli_query($con, $sql_f1);
$sql_yo1 = 'SELECT * FROM field_category_action JOIN category_action WHERE field_category_action.category_action_id = category_action.id AND category_action.category_id='.$category.' ORDER BY field_category_action.ordering';






$_return .= '
    </div>
    <div class="hidden-phone hidden-tablet">

        <form id="search_inside" class="form-search" method="POST" action="?page=search&extra=search">

            <input type="hidden" name="searching_inside" value="1">
            <input type="hidden" name="searchin" value="1">

           <input type="hidden"   name="category"  value="'.$query.'">
           <input type="hidden"   name="query" value="'.$category.'">

      <ul class="nav nav-tabs"> <li class="active">      <a href="#">Home</a>    </li>
        <li><a href="#"> κριτηριο 1...</a></li>
        <li><a href="#"> κριτηριο 2 </a></li>
      </ul>

      <ul class="nav nav-tabs">
         <li class="active">   <a href="#"> Neo krithrio </a>     </li>
        <li><a href="#"> κριτηριο 1...</a></li>
     </ul>


<select id="categories_extra"  name="categories_extra" class="chosen-select" tabindex="-1"  multiple="" data-placeholder="Κριτήρια"    style="width:160px;  float:left; ">

   <option value="0"></option>
     <optgroup label="Τιμή">
                <option value="1"> >100</option>
                <option value="2"> >200</option>
                <option value="3"> >300</option>
       </optgroup>
          <optgroup label="Διάφορα">
                 <option value="4"> Νερο </option>
                <option value="5">  Ενα</option>
       </optgroup>



</select>

<br /><br />

<div class="accordion" id="accordion2"  style="width:160px;  float:left; ">
  <div class="accordion-group">
    <div class="accordion-heading">
      <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseOne">
        Τιμή
      </a>
    </div>
    <div id="collapseOne" class="accordion-body collapse in">
      <div class="accordion-inner">
         Μεγάλη ...
      </div>
        <div class="accordion-inner">
         Μεγάλη ...2
      </div>
    </div>
  </div>
  <div class="accordion-group">
    <div class="accordion-heading">
      <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseTwo">
        Χρονολογία

              </a>
    </div>
    <div id="collapseTwo" class="accordion-body collapse">
      <div class="accordion-inner">
        Παλιό
      </div>
         <div class="accordion-inner">
        Νέο
      </div>
    </div>
  </div>
</div>


<br /><br />
    <p style="margin: auto;">
            <button type="submit" style="margin: auto;" class="btn btn-info btn-small"> ανανέωση </button>

</p>

    </form>
         </div>
         </div>';


    echo $_return;